package edu.kjxy.demo0322;

import java.util.Scanner;

public class demo04 {

	public static void main(String[] args) {
		int[] a = new int[5];
		
		System.out.println("请输入5个成绩：");
		Scanner in = new Scanner(System.in);
		
		for (int i = 0; i < a.length; i++) {
			a[i] = in.nextInt();
		}
		in.close();
		
		int sum = 0;
		for (int i = 0; i < a.length; i++) {
			sum += a[i];
		}
		
		System.out.println(1.0 * sum / a.length);
		
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < a.length; i++) {
			if(a[i] > max) max = a[i];
			if(a[i] < min) min = a[i];
		}
		System.out.println("max = %d, min = %d".formatted(max, min));
	}

}
